package main

import "fmt"

func NumJewelsInStones(J string, S string) int {
	dic := make(map[rune]int)
	for _, str := range S {
		dic[str] += 1
	}
	res := 0
	for _, str := range J {
		res += dic[str]
	}
	return res
}

func main() {
	res := NumJewelsInStones("aA", "aAAbbbb")
	fmt.Println(res)
}
